Refactor sparse checkout template: idempotency and no yaml loops#1627
Merged
2 commits merged intoAzure:masterfrom May 25, 2021
benbp:benbp/sparse-checkout-script
Merged
Refactor sparse checkout template: idempotency and no yaml loops#16272 commits merged intoAzure:masterfrom benbp:benbp/sparse-checkout-script
2 commits merged intoAzure:masterfrom
benbp:benbp/sparse-checkout-script
Conversation
Collaborator
|
The following pipelines have been queued for testing: |
weshaggard
reviewed
May 24, 2021
weshaggard
reviewed
May 24, 2021
weshaggard
reviewed
May 24, 2021
Collaborator
|
The following pipelines have been queued for testing: |
This was referenced May 25, 2021
weshaggard
approved these changes
May 25, 2021
|
Hello @azure-sdk! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This updates the sparse checkout template to be able to be called multiple times with new paths/repositories, and handle already cloned/checked out repositories.
Running
git sparse-checkout addmultiple times, as opposed to a single time with multiple arguments, can take a significantly longer amount of time. Similarly, re-runninggit sparse-checkout setmay or may not lose context from earlier pipeline steps which may have iteratively built up all required paths for a given build/test run.The change to this script handles all above conditions, and also gets rid of all the template looping constructs. By only using powershell logic (aside from
convertToJson), the script is easier to test locally, and also no longer adds many steps to the job output page when there are a lot of repositories to be checked out.Finally, this code can't actually be stored as a separate script file, because then there is a chicken/egg problem with checkout out the script in order to run it in order to check out the repo.